package com.dayang.nm.ugcaudit.action;

import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.sf.json.JSONObject;

import org.apache.log4j.Logger;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import com.dayang.baseplatform.model.CommonDisplay;
import com.dayang.baseplatform.service.ugcaudit.AutoAuditListService;
import com.dayang.baseplatform.service.ugcaudit.MemoService;

public class MemoAction extends BaseAction {
	
	@Override
	public String create(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		return null;
	}

	@Override
	public String delete(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		return null;
	}

	@Override
	public String update(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		return null;
	}

	@Override
	public String read(ActionMapping mapping, ActionForm form, HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		
		String programId = request.getParameter("programId");
//		String startStr = request.getParameter("start");
//		String countStr = request.getParameter("count");
		
//		int start = Integer.parseInt(startStr);
//		int count = Integer.parseInt(countStr);
		
		
		MemoService service = new MemoService();
		Map auditView = service.read(programId);
		
		JSONObject object = JSONObject.fromBean(auditView);
		String jsonStr = object.toString();
		
		return jsonStr;
	}
	
	//tomato princess...
	
}
